package com.example.uCenter.user.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.sql.Blob;
import java.time.LocalDateTime;

/**
 * 用户实体类
 *
 * @author xxs
 * @since 2022-08-27 08:20:38
 */
@Data
@TableName(value = "user")
public class User implements Serializable {

    @ApiModelProperty("ID")
    @TableId("user_id")
    private Integer userId;

    @ApiModelProperty("用户名")
    @TableField("user_name")
    private String userName;

    @ApiModelProperty("密码")
    @TableField("password")
    private String password;

    @ApiModelProperty("用户类型（0表示普通用户，用户属于管理员：1表示A网站，2表示B...）")
    @TableField("user_type")
    private Integer userType;

    @ApiModelProperty("盐")
    @TableField("salt")
    private String salt;

    @ApiModelProperty("等级")
    @TableField("lev")
    private Integer lev;

    @ApiModelProperty("性别")
    @TableField("sex")
    private String sex;

    @ApiModelProperty("身份证号")
    @TableField("Id_card")
    private String idCard;

    @ApiModelProperty("头像")
    @TableField("avatar")
    private Blob avatar;

    @ApiModelProperty("签名")
    @TableField("sign")
    private String sign;

    @ApiModelProperty("逻辑删除标记（0表示正常,1表示删除）")
    @TableField("is_deleted")
    @TableLogic
    private Integer isDeleted;

    @ApiModelProperty("状态（0表示正常，1表示静止用户）")
    @TableField("status")
    private Integer status;

    @ApiModelProperty("创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    @TableField("update_time")
    private LocalDateTime updateTime;

    @ApiModelProperty("记住我")
    @TableField(exist = false)
    private int rememberMe;
    public void setRememberMe(int rememberMe) {
        this.rememberMe = rememberMe;
    }
}
